var db = require('../middleware/connection.js').db();

module.exports = function(app) {
	

	app.get('/',function(req,res){
	console.log('Request from: '+req.ip);
	console.log('on tick: '+tick+' //');
	res.render('index.html');

	});


	app.get('/success',function(req,res) {
		console.log('session.uid: '+req.session.uid);
		sql = "SELECT * FROM browsergame.user WHERE user_id="+req.session.uid
		db.query(sql,function(err,result){
			console.log(sql);
			
			res.render('success.ejs', {
			username: result[0].username
			});
		});
		
	});

	// 
	//
}